External preprocessors and transformers communicate with MoPress over standard input (stdin) and standard output (stdout) via JSON. You can write plugins in Python, Node.js, Go, Rust, or any CLI environment.
Request (stdin): MoPress writes a JSON payload containing site config, file target, input type, and content payload.
Response (stdout): The plugin returns processed JSON (
{ "data": ... }). An empty stdout indicates the content was untouched.Error Reporting: Non-zero exit code or stderr output halts the build process with error diagnostics.
{
"config": { ... },
"type": "markdown-text", // or "markdown-ast"
"data": "raw text or serialized AST blocks",
"target": "path/to/page.md"
}
{
"data": "transformed text or AST blocks"
}